﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace InterfaceFiles
{
  public class XPSWMM10InterfaceFile : IInterfaceFile
  {
    private IInterfaceReader reader;
    private IInterfaceWriter writer;

    private XPSWMM10InterfaceHeader header;
    private XPSWMM10InterfaceRecord currentRecord;

    public XPSWMM10InterfaceFile(string fileName)
    {
      reader = new XPSWMM10InterfaceReader(fileName);
      writer = null; // to be relaced by an appropriate writer

      header = new XPSWMM10InterfaceHeader(reader);
      header.Read();
      currentRecord = new XPSWMM10InterfaceRecord(reader, header.Nodes);
    }

    public void Write(IInterfaceHeader header)
    {
      throw new NotImplementedException();
    }
  
    public void WriteRecord(IInterfaceRecord record)
    {
      throw new NotImplementedException();
    }

    public void WriteHeader(IInterfaceHeader header)
    {
 	    throw new NotImplementedException();
    }

    public IInterfaceRecord ReadRecord()
    {
      currentRecord.Read();
 	    return currentRecord;
    }

    public IInterfaceHeader ReadHeader()
    {
      return header;
    }

    public void WriteInterface(IInterfaceFile interfaceFile)
    {
      throw new NotImplementedException();
    }

    public bool IsEndOfFile
    {
      get { return reader.IsEndOfFile; }
    }
  }
}
